
package dao;

import java.util.List;

import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.classic.Session;
import pojo.ChiTietDonDatHang;
import pojo.ChiTietDonDatHang;
import util.HibernateUtil;

/**
 *
 * @author OSIRIS
 */
public class ChiTietDonDatHangDAO extends AbstractDAO{
 
   public ChiTietDonDatHangDAO() {
        super();
    }

    /**
     * Insert a new ChiTietDonDatHang into the database.
     * @param info
     */
    public void create(ChiTietDonDatHang info) throws DataAccessLayerException {
        super.saveOrUpdate(info);
    }


    /**
     * Delete a detached ChiTietDonDatHang from the database.
     * @param info
     */
    public void delete(ChiTietDonDatHang info) throws DataAccessLayerException {
        super.delete(info);
    }

    /**
     * Find an ChiTietDonDatHang by its primary key.
     * @param id
     * @return
     */
    public ChiTietDonDatHang find(Integer id) throws DataAccessLayerException {
        return (ChiTietDonDatHang) super.find(ChiTietDonDatHang.class, id);
    }

    /**
     * Updates the state of a detached ChiTietDonDatHang.
     *
     * @param info
     */
    public void update(ChiTietDonDatHang info) throws DataAccessLayerException {
        super.saveOrUpdate(info);
    }

    /**
     * Finds all ChiTietDonDatHangs in the database.
     * @return
     */
    public List findAll() throws DataAccessLayerException{
        return super.findAll(ChiTietDonDatHang.class);
    }
}
